

var moldYxjsDialog = {
	oThis: null,
	oFooter: null,
	dialog: null,

	detail: null,

	init: function () {
		this.initState();
		this.initEvent();
	},
	initState: function () {
		this.oThis = $('#yxjsDialog');
		this.oFooter = this.oThis.find('._footer');
		this.dialog = new TheDialog('#yxjsDialog');
	},
	initEvent: function () {
		var _this = this;

		this.oThis.find('.submit-btn').on('click', function () {
			_this.submit();
		})
	},
	show: function (detail) {
		this.detail = detail;
		this.dialog.show();

		this.setDetailHtml();
	},

	submit: function () {
		var _this = this;
		var param = {
			id: this.detail.id
		}
		$.ajax({
			type: 'get',
			url: pb.api + '/task/receive',
			data: param,
			success: function (res) {
				if (res.result == "true") {
					_this.dialog.close();
					Qmsg.success('影像接收成功');
					oPage.getData();
				} else {
					Qmsg.error(res.message);
				}
			}
		})
	},

	setDetailHtml: function () {
		var html = '';

		this.oThis.find('.sqdh-text').html(this.detail ? this.detail.applyNo : '-');
		this.oThis.find('.sqsj-text').html(this.detail ? this.detail.applyTime : '-');
		this.oThis.find('.sqks-text').html(this.detail ? this.detail.deptName : '-');
		this.oThis.find('.sqys-text').html(this.detail ? this.detail.doctorName : '-');
		this.oThis.find('.hzxm-text').html(this.detail ? this.detail.patientName : '-');
		this.oThis.find('.xb-text').html(this.detail ? this.detail.sex : '-');
		this.oThis.find('.nl-text').html(this.detail ? this.detail.age : '-');
		this.oThis.find('.dzbw-text').html(this.detail ? this.detail.partName : '-');
		this.oThis.find('.jcbw-text').html(this.detail ? this.detail.checkPointMethod : '-');
		this.oThis.find('.serial-text').html(this.detail ? this.detail.seriaiuid : '-');
		this.oThis.find('.xlms-text').html(this.detail ? this.detail.sequenceMark : '-');
		
		if (this.detail.receiveState == 1) {
			this.oFooter.hide();
		} else {
			this.oFooter.show();
		}
	},
}

$(function () {
	moldYxjsDialog.init();
})

